package com.linux.huhx.thread3.condition_1;

/**
 * @Author: huhx
 * @Date: 2017-10-30 下午 3:20
 */
public class ConditionTest {
    public static void main(String[] args) throws InterruptedException {
        MyService myService = new MyService();
        ThreadA threadA = new ThreadA(myService);
        threadA.start();
        Thread.sleep(1000 * 3);
        myService.signal();
    }
}

class ThreadA extends Thread {
    private MyService myService;

    public ThreadA(MyService myService) {
        super();
        this.myService = myService;
    }

    @Override
    public void run() {
        myService.await();
    }
}